package com.im.common.constant;

/**
 * 常量配置类
 */
public class Constants {

    /**
     * channel绑定的userId Key
     */
    public static final String UserId = "userId";

    /**
     * channel绑定的appId
     */
    public static final String AppId = "appId";

    /**
     * 客户端类型
     */
    public static final String ClientType = "clientType";

    /**
     * IMEI
     */
    public static final String Imei = "imei";

    /**
     * channel绑定的clientType和imei Key
     */
    public static final String ClientImei = "clientImei";

    /**
     * 读取时间
     */
    public static final String ReadTime = "readTime";

    /**
     * IM核心Zookeeper根节点
     */
    public static final String ImCoreZkRoot = "/im-coreRoot";

    /**
     * IM核心Zookeeper根节点（TCP）
     */
    public static final String ImCoreZkRootTcp = "/tcp";

    /**
     * IM核心Zookeeper根节点（Web）
     */
    public static final String ImCoreZkRootWeb = "/web";

    /**
     * Redis常量配置类
     */
    public static class RedisConstants {

        /**
         * 用户签名，格式：appId:userSign:
         */
        public static final String userSign = "userSign";

        /**
         * 用户上线通知channel
         */
        public static final String UserLoginChannel = "signal/channel/LOGIN_USER_INNER_QUEUE";

        /**
         * 用户会话，格式：appId + UserSessionConstants + 用户id，例如10000：userSession：lld
         */
        public static final String UserSessionConstants = ":userSession:";

        /**
         * 缓存客户端消息防重，格式：appId + :cacheMessage: + messageId
         */
        public static final String cacheMessage = "cacheMessage";

        /**
         * 离线消息
         */
        public static final String OfflineMessage = "offlineMessage";

        /**
         * 序列前缀
         */
        public static final String SeqPrefix = "seq";

        /**
         * 用户订阅列表，格式：appId + :subscribe: + userId。Hash结构，field为订阅自己的人
         */
        public static final String subscribe = "subscribe";

        /**
         * 用户自定义在线状态，格式：appId + :userCustomerStatus: + userId。Set，value为用户id
         */
        public static final String userCustomerStatus = "userCustomerStatus";

    }

    /**
     * RabbitMQ相关常量配置类
     */
    public static class RabbitConstants {

        /**
         * 用于用户服务与消息服务之间的消息队列通信
         */
        public static final String Im2UserService = "pipeline2UserService";

        /**
         * 用于消息服务与群组服务之间的消息队列通信
         */
        public static final String Im2MessageService = "pipeline2MessageService";

        /**
         * 用于消息服务与群聊服务之间的消息队列通信
         */
        public static final String Im2GroupService = "pipeline2GroupService";

        /**
         * 用于消息服务与好友关系服务之间的消息队列通信
         */
        public static final String Im2FriendshipService = "pipeline2FriendshipService";

        /**
         * 用于消息服务向消息处理管道发送消息
         */
        public static final String MessageService2Im = "messageService2Pipeline";

        /**
         * 用于群组服务向消息处理管道发送消息
         */
        public static final String GroupService2Im = "GroupService2Pipeline";

        /**
         * 用于好友关系服务向消息处理管道发送消息
         */
        public static final String FriendShip2Im = "friendShip2Pipeline";

        /**
         * 用于存储点对点消息的消息队列
         */
        public static final String StoreP2PMessage = "storeP2PMessage";

        /**
         * 用于存储群聊消息的消息队列
         */
        public static final String StoreGroupMessage = "storeGroupMessage";
    }


    /**
     * 回调命令常量配置类
     */
    public static class CallbackCommand {

        /**
         * 用户修改后的回调命令
         */
        public static final String ModifyUserAfter = "user.modify.after";

        /**
         * 创建群组后的回调命令
         */
        public static final String CreateGroupAfter = "group.create.after";

        /**
         * 更新群组后的回调命令
         */
        public static final String UpdateGroupAfter = "group.update.after";

        /**
         * 销毁群组后的回调命令
         */
        public static final String DestoryGroupAfter = "group.destory.after";

        /**
         * 转移群组后的回调命令
         */
        public static final String TransferGroupAfter = "group.transfer.after";

        /**
         * 添加群组成员前的回调命令
         */
        public static final String GroupMemberAddBefore = "group.member.add.before";

        /**
         * 添加群组成员后的回调命令
         */
        public static final String GroupMemberAddAfter = "group.member.add.after";

        /**
         * 删除群组成员后的回调命令
         */
        public static final String GroupMemberDeleteAfter = "group.member.delete.after";

        /**
         * 添加好友前的回调命令
         */
        public static final String AddFriendBefore = "friend.add.before";

        /**
         * 添加好友后的回调命令
         */
        public static final String AddFriendAfter = "friend.add.after";

        /**
         * 更新好友信息前的回调命令
         */
        public static final String UpdateFriendBefore = "friend.update.before";

        /**
         * 更新好友信息后的回调命令
         */
        public static final String UpdateFriendAfter = "friend.update.after";

        /**
         * 删除好友后的回调命令
         */
        public static final String DeleteFriendAfter = "friend.delete.after";

        /**
         * 添加黑名单后的回调命令
         */
        public static final String AddBlackAfter = "black.add.after";

        /**
         * 删除黑名单的回调命令
         */
        public static final String DeleteBlack = "black.delete";

        /**
         * 发送消息后的回调命令
         */
        public static final String SendMessageAfter = "message.send.after";

        /**
         * 发送消息前的回调命令
         */
        public static final String SendMessageBefore = "message.send.before";

    }


    /**
     * 序列常量配置类
     */
    public static class SeqConstants {

        /**
         * 消息序列常量
         */
        public static final String Message = "messageSeq";

        /**
         * 群组消息序列常量
         */
        public static final String GroupMessage = "groupMessageSeq";

        /**
         * 好友关系序列常量
         */
        public static final String Friendship = "friendshipSeq";

        /**
         * 好友请求序列常量
         */
        public static final String FriendshipRequest = "friendshipRequestSeq";

        /**
         * 好友群组序列常量
         */
        public static final String FriendshipGroup = "friendshipGroupSeq";

        /**
         * 群组序列常量
         */
        public static final String Group = "groupSeq";

        /**
         * 会话序列常量
         */
        public static final String Conversation = "conversationSeq";

    }


}
